Skip to main content

TRREST_CNDB

This project covers all the test cases of REST trigger and DB connector.

Sr. NoService NameDescriptionDetails
1.getSingleRecordGet single record from the database(customer table) and tranform it to REST response.
2.getMultipleRecordGet multiple records from the database(customer table) and tranform it to REST response.
3.getQueryParamGet records from the database(customer table) for speficied QUERY parameter and tranform the result in to REST response.
4.getPathParamGet records from the database(customer table) for speficied PATH parameter and tranform the result in to REST response.
5.getPathMultiParamsGet records from the database(customer table) for speficied 3 PATH parameter and tranform the result in to REST response.( all the 3 path params should be present in URI
6.getComplexQueryGet records from database table with multiple query paramaters (3), all parameters should be present
7.getQueryParamGlobalErrorGet records from database with specifid Query Parameter. Create a global exception handling component to Send CUSTOM error message if no Data found for given paramater key-value pair. i.e. Custoemr ID (global exception to handle business error scenario)
8.getQueryParamStepErrorGet record from database customer table with specified QUERY Parameter . Add Techncial exception (step exception ) component to handle error when no Custoemr ID was passed and you were expecting the same in Query parameter (step exception to handle technical error scenario, e.g. user did not mention correct id)
9.getPathParamGlobalErrorGet record from database with single Path Parameter. Add Global exception component to handle error message if no Data found for given Path Parameter (same as above but for path params)
10.getPathParamStepErrorGet record from database customer table for multiple Path Parameters Create a Step exception component to handle techncial exception when one of the two path parameters is not passed (same as above but for path params)
11.deleteRecordRest DELETE . Delete data from Customer Table
12.deleteRecordRest DELETE. Delete from Customer Table . Techncial exception handling when no Custoemr ID was passed and you were expecting the same in Query parameter (URI validator to check if ID is present before deletion)
13.postSingleRecordREST POST. Insert Record in Customer DB . Post body created using request paylaod.
{
"ID": 815823677,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
14.postMultipleRecordsREST POST . Insert Multipel Records in Custoemr DB Post body created using request paylaod.
{
"customers": [
{
"ID": 1905654704,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": "KP",
"city": "Pune",
"state": "MH",
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
},
{
"ID": 1938885300,
"Name": "Manish",
"LastName": "Deshpande",
"FirstName": "Manish",
"phone": "4044442555",
"Address1": "Pune",
"Address2": "Kothrud",
"city": "Pune",
"state": "Maharashtra",
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1333451.25
}
]
}
15.postWrongBodyREST POST . Exception handlign when body schema is not correct . Post body created using request paylaod.
{
"id": 1801902891,
"name": "Lois Griffin",
"last name": "Griffin",
"first name": "Lois",
"phone": "40.32.2555",
"address line 1": "54, rue Royale",
"address line 2": null,
"city": "Nantes",
"state": null,
"postal": "44000",
"country": "France",
"employee ref number": 1702,
"credit limit": 1451.25
}
16.postDynamicBodyREST POST Dynamic Scheam created using PayLoad . Read custoemr data for given cust id and create payload .Using payload component generate payload which will be inserted in DB
{
"ID": 807680292,
"Name": "Snehal",
"City": "Pune",
"LastName": "Kulkarni",
"FirstName": "Snehal",
"Phone": "4555666777",
"Address1": "Yerwada",
"Address2": "Alandi",
"creditlimit": 1422251.25
}
17.updateRecordREST PUT . Update the Customer Record
{
"ID": 412,
"phone": "4040404040",
"city": "Amravati",
"state": null,
"country": "India",
"creditLimit": 200000.25
}
18.getDataOnMultiConditionsSelect records which match multiple conditions ( using other operators than ==), Records are fetched from payments table by providing mendatory query parameter amount and paymentDate. Query uses >= operator with amount and IN operator with paymentDate for fetching the data.
19.getMultiTableRecordsDB query having Join of multiple table
20.getCustomQueryComplex DB Select Query having SQL functions like sql functions. In this sample a select query is executed which uses concat() and substring_index() funcations to demostrate the usage of custom query which uses sql functions. (query genrator is not used)
21.postMultipleUpdateInSingleTableUpdate more than one records in single table. In this sample post method is used to update multiple records in a table using the values recieved from the payload. (query generator is used)
{
"creditLimit": 25000.01,
"fromCredit": 50000,
"toCredit": 60000
}
22.postMultipleUpdateInMultipleTableUpdate records in multiple DB tables (single transaction). In this sample, 2 update queries are used with different tables. One uses query generator and another uses mix of query generator and custom query. If one fails transaction is rolled back.
{
"creditLimit": 35000,
"fromCredit": 45000,
"toCredit": 50000,
"quantityOrdered": 50
}
23.postMultipleDeleteInSingleTabledelete multiple records in single query. In this sample a simple query is used that will delete multiple records according to a specific input that will be posted as request body (Query generator is used)
{
"city": "bongaigaon"
}
24.postMultipleDeleteInMultipleTabledelete multiple records in multiple queries (i.e. from different tables) single transaction. In this sample two queries are used that will delete multiple records in two different tables, according to specific input that will be posted as request body (Query generator is used)
{
"city": "bongaigaon",
"status": "pending"
}
25.PostMultiTableInsertinsert multiple records in multiple queries (i.e. from different tables) single transaction
{
"ID": 961308627,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25,
"status": "UPDATED",
"reminder": 1
}
26.postReinsertdelete and insert in single transaction
{
"officeCode": 222,
"city": "pune",
"phone": "1234567",
"addressLine1": "near baner",
"addressLine2": "",
"state": "maha",
"country": "india",
"postalCode": "54545",
"territory": "none"
}
27.postInsertUpdateinsert and update in single transaction, In this sample two queries were used to insert and update in the same table.(query generator is used)
{
"customerNumber": 133,
"orderNumber": 1113,
"status": "pending"
}
28.postUpdateDeleteCreate 2 queries, update and delete. Fail the update.(transaction rollback). Delete should not get executed
{
"oldId": "333",
"newId": "89898",
"deletionId": 107
}
29.bulkUpdateBulk update (Create a Bulk Update query from DB component) and then in response shows the record ids that were updated
{
"customers": [
{
"ID": 108,
"phone": "4040404040",
"city": "Amravati",
"state": "Andhra Pradesh"
},
{
"ID": 103,
"phone": "555555555",
"city": "Amravati",
"state": "Telangana"
}
]
}
30.bulkInsertBulkInsert of records in a sinfle table.
{
"customers": [
{
"id": 914545147,
"name": "Supriya",
"lastName": "Deshpande",
"firstName": "Supriya",
"phone": "40.32.2555",
"address1": "Pune",
"address2": "Alandi",
"city": "Pune",
"state": "MH",
"pincode": "411007",
"country": "India",
"empID": 1702,
"creditLimit": 1451.25
},
{
"id": 440106432,
"name": "Priya",
"lastName": "Deshpande",
"firstName": "Supriya",
"phone": "4044442555",
"address1": "Pune",
"address2": "pune",
"city": "Pune",
"state": "MH",
"pincode": "411007",
"country": "India",
"empID": 1702,
"creditLimit": 1333451.25
}
]
}
31.bulkDeleteBulkDelete of records within a single table
32.deleteMultipleRecordsDelete multiple records from success_result table to limit the entries
{
"status": "Dispached"
}
33.queryParamExistsException handling and response in case of Expected QueryParameter is empty
34.getSingleRecordManualGet single record from the database(customer table) using manual querry and tranform it to REST response.
35.postSingleRecordManualPost single record from the database(customer table) using manual querry and tranform it to REST response.
{
"ID": 246279071,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
36.putSingleRecordManualUpdate single record from the database(customer table) using manual querry and tranform it to REST response.
{
"ID": 412,
"phone": "4040404040",
"city": "Amravati",
"state": null,
"country": "India",
"creditLimit": 200000.25
}
37.deleteSingleRecordManualDelete single record from the database(customer table) using manual querry and tranform it to REST response.
38.getSingleCountGet single record from the database(customer table) and tranform it to REST response should give the count of records as well as actual records
39.getMultipleRecordCountGet single record from the database(customer table) and tranform it to REST response should give the count of records as well as actual records
40.updateBulkCountBulk update (Create a Bulk Update query from DB component) and then in response shows the record ids that were updated. along with message that captures the exception 0 or 1
{
"customers": [
{
"ID": 108,
"phone": "4040404040",
"city": "Amravati",
"state": "Andhra Pradesh"
},
{
"ID": 103,
"phone": "555555555",
"city": "Amravati",
"state": "Telangana"
}
]
}
41.dbExceptionHandlingThis case involves handling of error data if there is any error while executing the db step. In this example, the query provided is incorrect, so the db will throw error of bad sql grammer. This error will be stored in "ERROR" object in the pipeline. Then we have step exception block where we have a step whcih will throw business exception, with message and code.
42.dbWithTimeoutsetting timeout. if connection take longer that set time, gives timeout error.
43.dbWithoutTimeoutsetting timeout. will not give error since not timeout occurs
44.putSingleRecordWhenNoFieldPassedPut rest with payload. Update query is called. targets for whome values are null or not available from the given key, "NULL" is put in their place. this is for manual query writing, rather than using query creator.
{
"ID": 412,
"phone": "4040404040",
"creditLimit": 200000.25
}
45.putSingleRecordSkipNullOnCheckedPut rest with payload. Update query is called. targets for whome values are null will be skipped from the querry.
{
"ID": 412,
"phone": "4040404040",
"city": "Amravati",
"state": "MH",
"country": "India",
"creditLimit": 200000.25
}
46.postSingleRecordSkipNullOnCheckedPost rest with payload. Insert query is called. targets for whome values are null will be skipped from the querry assuming these are not compulsory in DB table as well.
{
"ID": 1451651483,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
47.postDataDefaultDatatypeInserting data in database with the default datatypes.
{
"customerNumber": 10110,
"orderNumber": 187,
"status": "Shipped"
}
48.storedProcedureHappyPathRest service to call stored procedure in db. db step call with valid procedure name and its input parameter. Output is the result of all the statements in the stored procedure.
49.storedProcedureUnHappyPathRest service to call stored procedure in db. db step call with invalid procedure name. Throws exception that no such procedure name.